<template>
  <di class="son">
    <h1>查看用户信息</h1>
    <div class="bx">
      <h3>角色信息</h3>
      <table>
        <tr>
          <td>角色名称</td>
          <td>
            <input type="text">
          </td>
          <td>角色编号</td>
          <td><input type="text"></td>
          <td>上级</td>
          <td><input type="text"></td>
        </tr>
      </table>
      <h3>菜单信息</h3>
      <!-- <template #default="scope">
        <div class="lala">{{ scope.row.name }}</div>
      </template> -->
      <el-table :data="tableData" style="width: 100%">
    <el-table-column label="Date" width="180">
      <template #default="scope">
        <div style="display: flex; align-items: center">
          <el-icon><timer /></el-icon>
          <span style="margin-left: 10px">{{ scope.row.date }}</span>
        </div>
      </template>
    </el-table-column>
    <el-table-column label="" width="100">
      <template #default="scope">
        <el-popover effect="light" trigger="hover" placement="top" width="auto">
          <template #reference>
            <div class="lala" @click="changecolor" ref="mycolor">{{ scope.row.yi  }}</div>
          </template>
        </el-popover>
      </template>
    </el-table-column>
    <el-table-column label="" width="100">
      <template #default="scope">
        <el-popover effect="light" trigger="hover" placement="top" width="auto">
          <template #reference>
            <div class="lala"  @click="changecolor" ref="mycolor">{{ scope.row.er }}</div>
          </template>
        </el-popover>
      </template>
    </el-table-column>
    <el-table-column label="" width="100">
      <template #default="scope">
        <el-popover effect="light" trigger="hover" placement="top" width="auto">
          <template #reference>
            <div class="lala"  @click="changecolor" ref="mycolor">{{ scope.row.san  }}</div>
          </template>
        </el-popover>
      </template>
    </el-table-column>
    <el-table-column label="" width="100">
      <template #default="scope">
        <el-popover effect="light" trigger="hover" placement="top" width="auto">
          <template #reference>
            <div class="lala"  @click="changecolor" ref="mycolor">{{ scope.row.si }}</div>
          </template>
        </el-popover>
      </template>
    </el-table-column>
    <el-table-column label="" width="100">
      <template #default="scope">
        <el-popover effect="light" trigger="hover" placement="top" width="auto">
          <template #reference>
            <div class="lala"  @click="changecolor" ref="mycolor">{{ scope.row.wu }}</div>
          </template>
        </el-popover>
      </template>
    </el-table-column>
    <el-table-column label="" width="100">
      <template #default="scope">
        <el-popover effect="light" trigger="hover" placement="top" width="auto">
          <template #reference>
            <div class="lala"  @click="changecolor" ref="mycolor">{{ scope.row.liu }}</div>
          </template>
        </el-popover>
      </template>
    </el-table-column>
    <el-table-column label="" width="100">
      <template #default="scope">
        <el-popover effect="light" trigger="hover" placement="top" width="auto">
          <template #reference>
            <div class="lala"  @click="changecolor" ref="mycolor">{{ scope.row.qi }}</div>
          </template>
        </el-popover>
      </template>
    </el-table-column>
      </el-table>
      <h3>角色信息</h3>
      <el-radio-group v-model="radio1">
      <el-radio label="1" size="large" border>自己及下属</el-radio>
      <el-radio label="2" size="large" border>本部门</el-radio>
      <el-radio label="3" size="large" border>指定部门</el-radio>
      <el-radio label="4" size="large" border>查看全部</el-radio>
    </el-radio-group>
    <!-- 底部 -->
   
    <div class="flex">
   
    <el-button color="#999"  plain @click="myreturn()">返回</el-button>

    <el-button type="primary">保存</el-button>
    <el-button type="primary">提交</el-button>
    
  </div>
    </div>
  </di>
</template>

<script setup lang="ts">
import {useRouter} from 'vue-router'
import {ref} from 'vue'
import { Timer } from '@element-plus/icons-vue'
//element 组件
interface User {
  date: string
  name: string
  address: string
  yi:string
  er:string
  san:string
  si:string
  wu:string
  liu:string
  qi:string
}

const handleEdit = (index: number, row: User) => {
  console.log(index, row)
}
const handleDelete = (index: number, row: User) => {
  console.log(index, row)
}

const tableData: User[] = [
  {
    date: '菜单一',
    name: '111',
    address: 'No. 189, Grove St, Los Angeles',
    yi:'查看',
    er:'新增',
    san:'查看',
    si:'修改',
    wu:'删除',
    liu:'提交',
    qi:'导入',
    
  },
  {
    date: '菜单二',
    name: '111',
    address: 'No. 189, Grove St, Los Angeles',
    yi:'查看',
    er:'新增',
    san:'查看',
    si:'修改',
    wu:'删除',
    liu:'提交',
    qi:'导入',
    
    
  },
  {
    date: '菜单二',
    name: '111',
    address: 'No. 189, Grove St, Los Angeles',
    yi:'查看',
    er:'新增',
    san:'查看',
    si:'修改',
    wu:'删除',
    liu:'提交',
    qi:'导入',
    
    
  },
  {
    date: '菜单三',
    name: '111',
    address: 'No. 189, Grove St, Los Angeles',
    yi:'查看',
    er:'新增',
    san:'查看',
    si:'修改',
    wu:'删除',
    liu:'提交',
    qi:'导入',
    
    
  }
]
//点击改变颜色

let mycolor:any = ref(null)
let changecolor = ()=>{
  console.log('获取的dom元素',mycolor.value);
  mycolor.value.style.backgroundColor = '#409eff'
  mycolor.value.style.color = 'fff'
}
//底部单选框
const radio1 = ref('1')
let router = useRouter()
let myreturn = ()=>{
   router.push('/home/systemset/systemsetb')
}
</script>

<style scoped>
.bx {
  width: 1100px;
  margin: auto;
}
.son h1 {
  font-size: 22px;
}
table {
   border-collapse: collapse;
   text-align: center;
}
table tr td {
  border: 1px solid #999;
  height: 45px;
  width: 180px;
}
table tr td input{
 border: 1px solid transparent;
  width: 250px;
  height: 45px;
 }
.lala {
  width: 80px;
  height: 25px;
  background-color: #fff;
  border-radius: 5px;
  text-align: center;
}
.el-radio {
   margin-right: 50px;
}
.flex {
  margin: 20px 20px 0px 800px;
}
</style>